const mongoose = require("mongoose");


const recipe = mongoose.Schema({
    // 发布用户id
    user_id: {
        type: mongoose.SchemaTypes.ObjectId,
        required: true,
        ref: 'user',
    },
    // 封面
    coverImg: {
        type: String,
        default: ''
        // required: true
    },
    // 标题
    title: {
        type: String,
        required: true
    },
    // 材料
    material: {
        type: Object,
        default: ''
        // required: true
    },
    // 步骤
    step: {
        type: Array,
        default: ''
        // required: true
    },
    // 时长
    cookingTime: {
        type: String,
        default: ''
        // required: true
    },
    // 难度
    difficulty: {
        type: String,
        default: ''
        // required: true
    },
    // 分类
    classList: {
        type: String,
        required: true
    },
    // 发布时间
    pushTime: {
        type: String,
        required: true
    },
    video: {
        type: String,
        default: ''
        // required: true
    },
    con: {
        type: String,
        default: ''
        // required: true
    },
    // 类型
    // 1为菜谱二为视频
    type: {
        type: String,
        required: true,
    }
});
module.exports = mongoose.model("recipe", recipe);




